using System;
using System.Collections.Generic;
using System.Text;

namespace RapidHDL.Fabric
{
    public class ConstantBlock : Block 
    {
        int iWidth;
        int iValue;

        public ConstantBlock(string psName,  int piValue, int piWidth)
            : base(psName,"CONST")
        {
            iWidth = piWidth;
            iValue = piValue;
            this.CreateOutput("OUT", piWidth);
        }

        internal override void GenerateStructure()
        {
            Constant oConstant = new Constant(ParentComponent, "const_" + sName, iWidth, iValue);
            Outputs["OUT"].LinkNodeVector(oConstant.OutputNodes);
        } 

    }
}
